package com.commerce.page;

import com.github.pagehelper.PageInfo;
import lombok.Data;

import java.util.List;

/**
 * @author wyj
 * @Title:分页对象
 * @Description:
 */
@Data
public class Page {

    private int page=1;
    private int limit=20;
    private int startRow;
    private int endRow;
    private long total;
    private int pages;
    private List list;

    public void setList(List list){
        PageInfo pageInfo = new PageInfo(list);
        this.list = pageInfo.getList();
        this.pages = pageInfo.getPages();
        this.total = pageInfo.getTotal();
        this.startRow = pageInfo.getStartRow();
        this.endRow = pageInfo.getEndRow();

    }

}
